<?php

namespace App\Models\Common;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class China extends Model
{
    use HasFactory;
    protected $table = 'china';

    public function moreChildren() {
        return $this->hasMany(China::class,'pcode','code')->orderBy('id');
    }

    public function children() {
        return $this->moreChildren()->with(['children']);
    }
}
